const exec = require('../db/mysql')

const add = (saler) => {
  const sql = `insert into saler(s_name) values (?)`
  const params = [saler.s_name]
  return exec(sql,params).then(insertSaler=>{
      return insertSaler.affectedRows
  })
}

const list = (dealer) => {
    const sql = `select * from dealer`
    return exec(sql,null).then(insertDealer=>{
        return insertDealer
    })
  }

module.exports = {
    add,list
}